package cangyan.msgcenter.utils;


import java.security.*;


public class MD5Util {

	public static String convert(String s) {
		try {
			byte[] bytes = ("tbk"+s).getBytes();
			MessageDigest md = MessageDigest.getInstance("MD5");
			md.update(bytes);
			bytes = md.digest();
			StringBuffer sb = new StringBuffer();
			for (int i = 0; i < bytes.length; i++) {
				int val = ((int) bytes[i]) & 0xff;
				if (val < 16)
					sb.append("0");
				sb.append(Integer.toHexString(val));
			}
			return sb.toString();
		} catch (Exception e) {
			return null;
		}
	}
	
	public static void main(String[] args) {
		System.out.println(convert("1"));
	}

}
